<?php

/**
 * @author minhtung
 * @copyright 2012
 */

defined('DSVH') or die('Restricted access');

function update_view_quang_cao($view, $id){
        mysql_query("update quang_cao set 
          view = '".$view."'
          where id = '".(int)$id."'", dbconnect());
    }    
     
function getQuangCao($id)
    {
    $pro = mysql_query("select * from quang_cao where id = '".(int)$id."'", dbconnect());
    return mysql_fetch_array($pro);
    }
    
function getListQuangCao($loai, $start, $limit)
    {
    $local_list = mysql_query("SELECT * FROM quang_cao where loai_id ='".$loai."'
     order by id desc limit  ".(int)$start.",".(int)$limit."
    
    ", dbconnect());
    $result = array();
    while ($local = mysql_fetch_array($local_list)){
        $result []= $local;
    }
    return $result;
    }


?>